package com.ccc.dao.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ccc.dao.UserStorageDao;
import com.ccc.model.UserStorage;
import com.ccc.util.dao.UtilDao;

@Component("userStorageDao")
public class UserStorageDaoImpl implements UserStorageDao {
	private UtilDao utilDao;

	@Override
	public void addUserStorage(UserStorage userStorage) {
		utilDao.save(userStorage);
	}

	@Override
	public void deleteUserStorage(UserStorage userStorage) {
		utilDao.delete(userStorage);
	}

	@Override
	public void updateUserStorage(UserStorage userStorage) {
		utilDao.update(userStorage);
	}

	@Override
	public UserStorage findUserStorage(int id) {
		return utilDao.find(UserStorage.class, id);
	}

	public UtilDao getUtilDao() {
		return utilDao;
	}

	@Resource
	public void setUtilDao(UtilDao utilDao) {
		this.utilDao = utilDao;
	}

}
